Page({
  data: {
    detail: {},
    marginPrice: 0,
    userInfo: {}
  },
  onLoad(query) {
  },
  onShow() {
    var carsource = wx.getStorageSync("carsource")
    var detail = JSON.parse(carsource);
    var userInfo = getApp().globalData.userInfo;
    this.setData({ detail: detail, userInfo: userInfo, marginPrice: detail.marginPrice - userInfo.marginPrice })
  },

  onPayPrice() {
    getApp().globalData.userInfo.marginPrice += this.data.marginPrice;
    console.log(getApp().globalData.userInfo)
    wx.navigateBack();
  }
});
